package com.senyint.imsdk;

public class DefaultSmackHelper {
    protected static final String TAG = DefaultSmackHelper.class.getSimpleName();
    
	private String host = "localhost" ;
    private Integer port = 5222 ;
    private String user = null ;
    private String password = null ;
	private String serviceName = "uos" ;//
	private String resourceName = "android" ;
	private ISdkConfig sdkConfig = null;
	private SmackHelper2 smackHelper = new SmackHelper2(){};

	public DefaultSmackHelper() {
		sdkConfig = new ISdkConfig(){
			/**
			 * 
			 */
			private static final long serialVersionUID = 2152164986814066170L;

			@Override
    		public String getUserName() {
    			return user ;
    		}

    		@Override
    		public String getServiceName() {
    			return serviceName  ;
    		}

    		@Override
    		public String getResourceName() {
    			return resourceName ;
    		}

    		@Override
    		public String getUserJID() {
    			return user+"@"+getServiceName()+"/"+getResourceName();
    		}

    		@Override
    		public String getPassword() {
    			return password ;
    		}

    		@Override
    		public void clear() {
    			user = null ;
    			password = null ;
    		}

			@Override
			public String getHost() {
				return host  ;
			}

			@Override
			public Integer getPort() {
				return port ;
			}
    	};
    	
    	smackHelper.build(sdkConfig);
	}

}
